package sig.web.struts.converters;

import java.util.Map;

import org.apache.struts2.util.StrutsTypeConverter;


public class EnumConverter extends StrutsTypeConverter {

	@Override
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Object convertFromString( Map context, String[] values, Class toClass) {
		String cadenaEnumSexo = values[0];
		return Enum.valueOf(toClass, cadenaEnumSexo);
	}

	@SuppressWarnings("rawtypes")
	@Override
	
	public String convertToString(Map context, Object enumGenerico) {
		return enumGenerico.toString();
	}

	
	

}
